<?php

namespace app\index\controller;

use app\common\CommonController;
use app\index\service\HandoverService;
use app\index\service\ImportexportService;

class Handover extends CommonController
{
    public function __construct(){
        parent::__construct();
    }
    public function index(){
        $res = HandoverService::getHandoverList($this->param);
        exitJson($res);
    }


    //导出列表
    public function export()
    {
        $this->param['actionAsync'] = "\app\index\service\HandoverService::getHandoverList";
        $result = ImportexportService::exportLogic($this->param, 50);
        exitJson($result);
    }
    //编辑新品sku
    public function edit(){
        checkParam($this->param, ['e'], 'sku');
        exitJson(HandoverService::edit($this->param));
    }
    //上传新品sku
    public function uploadAdd(){
        $param = $this->param;
        $param['actionAsync'] = "\app\index\service\HandoverService::uploadAdd";
        $result = ImportexportService::importTask($param, 5,2);
        exitJson($result);
    }
}